//config

var path = require('path');
var fs = require('fs');

//初始化日志信息
var logDir = "./logs",
    logName = "webstudio.log",
    logPath = logDir + '/' + logName;
if (!fs.existsSync(logDir)) {
    fs.mkdirSync(logDir);
}

var config = {
    debug: true,
    db: 'mongodb://127.0.0.1/wedstudio_dev',
    //服务器设置
    hostname: 'localhost',
    port: '3000',

    //session
    session_backend: 'session_backend_wedstudio',
    cookie_backend: 'cookie_backend_wedstudio',

    //日志配置
    log: {
        name: 'wedstudio',
        streams: [{
            level: 'info',
            stream: process.stdout // log INFO and above to stdout
        }, {
            level: 'error',
            path: logPath // log ERROR and above to a file
        }]
    }
};

module.exports = config;